package com.mogist.hqc.module.personal.presenter

import com.mogist.hqc.entitys.BaseResponse
import com.mogist.hqc.module.personal.contract.InfoContract
import com.mogist.hqc.mvp.HttpDto
import com.mogist.hqc.mvp._PresenterImpl
import com.mogist.hqc.util.Constant
import talex.zsw.basecore.view.dialog.sweetalertdialog.SweetAlertDialog

/**
 * 作用：个人资料
 * 作者：赵小白 email:vvtale@gmail.com  
 * 修改人：
 * 修改时间：
 * 修改备注：
 */
class InfoPresenter(view: InfoContract.View) : _PresenterImpl<InfoContract.View, BaseResponse>(view), InfoContract.Presenter
{
    override fun requestSuccess(response: BaseResponse, http: HttpDto)
    {
        when (http.url)
        {
            Constant.PERSONAL_INFO_UPDATE ->
            {
                if (response.success)
                {
                    mView.uploadSuccess()
                }
                else
                {
                    mView.showDialog(SweetAlertDialog.ERROR_TYPE, "修改用户信息失败", response.message)
                }
            }
        }
    }
}